package com.yunji.system.service.impl;

import com.yunji.common.model.params.EventRecordParam;
import com.yunji.common.model.vo.EventRecordVO;
import com.yunji.common.utils.bean.BeanUtils;
import com.yunji.system.dao.IEventRecordDao;
import com.yunji.system.service.IEventRecordService;
import com.yunji.system.service.convert.EventRecordConvert;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Service
public class EventRecordServiceImpl implements IEventRecordService {

    @Resource
    IEventRecordDao eventRecordDao;

    @Override
    public List<EventRecordVO> search(EventRecordParam param) {
        if (BeanUtils.isNull(param.getEventDataId())){
            return new ArrayList<>();
        }
        return EventRecordConvert.domainTOVOList(eventRecordDao.search(param));
    }
}
